from .penbook import PenBook
def sp(
    book_name = None,
    novel_author = None,
    novel_author_url = None,
    novel_url = None,
    novel_intro = None,
    novel_type = None,
    refresh_time = None,
    novel_status = None,
    novel_words = None,
    novel_img = None,
    latest_chapter = None,
    latest_chapter_url = None
):

    penbook_url = 'https://www.biqugexsw.com'
    search_dict = {}

    for i in range(len(book_name)):
        try:
            info_dict = {
                'novel_author': novel_author[i],
                'novel_author_url': novel_author_url[i],
                'novel_url': penbook_url + book_name[i][0],
                'latest_chapter': latest_chapter[i][1],
                'latest_chapter_url': penbook_url + latest_chapter[i][0],
                'novel_type': novel_type[i],
                'refresh_time': refresh_time[i],
                'novel_status': novel_status[i],
                'novel_words': novel_words[i],
                'novel_img': penbook_url + novel_img[i]
            }
        except:
            continue
        else:
            search_dict[book_name[i][1]] = info_dict

    return search_dict



if __name__ == '__main__':
    x = PenBook(keyword='大主宰')
    print(x.searchinfo())

